/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package parse;

/**
 *
 * @author phong
 */
public class BasicCategory extends Category {
    
    String name;
        
    public BasicCategory(String name) {
        this.name = name;
        this.feature = "";
    }
    
    public BasicCategory(String name, String feature) {
        this.name = name;
        this.feature = feature;
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof BasicCategory) {
            BasicCategory that = (BasicCategory)other;
            return this.name.equals(that.name);
        }
        return false;
    }
    
    @Override
    public int hashCode() {
        return this.name.hashCode();
    }
    
    @Override
    public String toString() {
        return this.name;
    }
    
    @Override
    public Category leftMostRemove(Category cat) {
        return this;
    }
    
    @Override
    public Category rightMostRemove(Category cat) {
        return this;
    }
    
    @Override 
    public int numOfAllBasicCats() {
        return 1;
    }
}
